<template>
    <div style="border: 1px solid red;background-color: antiquewhite 20px;">
        我是子组件
        <button @click="toParentEvent">向父组件传递数据</button>
    </div>
    
</template>
<script setup>
import { ref } from 'vue';
let childData = ref('我是子组件的数据')
const emits = defineEmits(['toParent'])
const toParentEvent = ()=>{
    emits('toParent',childData.value)
}
</script>
<style scoped>

</style>